import 'package:flutter/material.dart';
import 'package:flutter_shop/pages/category/category_tab_page/entity/category_data.dart';

///子分类数据提供者
class SubCategoryProvider with ChangeNotifier {
  ///子分类数据
  List<CategoryDataBxMallSubDto> _subCategoryList = [];

  List<CategoryDataBxMallSubDto> get subCategoryList => _subCategoryList;

  ///改变子分类集合
  setSubCategoryList(List<CategoryDataBxMallSubDto> list) {
    CategoryDataBxMallSubDto child = CategoryDataBxMallSubDto();
    child.mallSubName = "全部";
    child.comments = null;
    child.mallCategoryId = "";
    child.mallSubId = "";
    _subCategoryList.clear();
    _subCategoryList.add(child);
    _subCategoryList.addAll(list);
    notifyListeners();
  }
}
